#ifndef CONFIGMANAGER_H
#define CONFIGMANAGER_H

#include <QObject>
#include <QJsonObject>
#include <QJsonDocument>
#include <QFile>
#include <QIODevice>
#include <QJsonParseError>
#include <QDebug>
#include <QDir>

class ConfigManager : public QObject
{
    Q_OBJECT

public:
    static ConfigManager& instance();

    bool loadConfig();
    bool saveConfig();
    QJsonObject getConfig() const;
    void setConfig(const QJsonObject &config);

private:
    ConfigManager(const QString &filePath);
    ConfigManager(const ConfigManager&) = delete;
    ConfigManager& operator=(const ConfigManager&) = delete;

    void copyConfigFile();

private:
    QString filePath;
    QJsonObject config;
};

#endif // CONFIGMANAGER_H
